/**
 * 
 */
package example.business.api.topic;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import com.vanstone.common.services.AbstractBusinessObject;
import com.vanstone.fs.weedfs.WeedFSFile;

/**
 * @author shipeng
 *
 */
public class Question extends AbstractBusinessObject {

  private static final long serialVersionUID = -8036057431571213395L;

  private Long id;
  private Date sysInsertTime;
  private String questionContent;
  private String remark;
  private long clickcount = 0;
  private long commentcount = 0;
  private long answercount = 0;
  private List<Tag> tags = new ArrayList<>();
  private boolean deleted = false;
  private List<WeedFSFile> imageFiles = new ArrayList<>();

  public long getAnswercount() {
    return answercount;
  }

  public void setAnswercount(long answercount) {
    this.answercount = answercount;
  }

  public boolean isDeleted() {
    return deleted;
  }

  public void setDeleted(boolean deleted) {
    this.deleted = deleted;
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }

  public Date getSysInsertTime() {
    return sysInsertTime;
  }

  public void setSysInsertTime(Date sysInsertTime) {
    this.sysInsertTime = sysInsertTime;
  }

  public String getQuestionContent() {
    return questionContent;
  }

  public void setQuestionContent(String questionContent) {
    this.questionContent = questionContent;
  }

  public String getRemark() {
    return remark;
  }

  public void setRemark(String remark) {
    this.remark = remark;
  }

  public long getClickcount() {
    return clickcount;
  }

  public void setClickcount(long clickcount) {
    this.clickcount = clickcount;
  }

  public long getCommentcount() {
    return commentcount;
  }

  public void setCommentcount(long commentcount) {
    this.commentcount = commentcount;
  }

  public List<Tag> getTags() {
    return tags;
  }

  public void setTags(List<Tag> tags) {
    this.tags = tags;
  }

  public void addTag(Tag tag) {
    if (tag == null) {
      return;
    }
    this.tags.add(tag);
  }

  public void addTags(List<Tag> tags) {
    if (tags == null || tags.size() <= 0) {
      return;
    }
    this.tags.addAll(tags);
  }

  public List<WeedFSFile> getImageFiles() {
    return imageFiles;
  }

  public void setImageFiles(List<WeedFSFile> imageFiles) {
    this.imageFiles = imageFiles;
  }

  public void addImageFile(WeedFSFile imageFile) {
    if (imageFile == null) {
      return;
    }
    this.imageFiles.add(imageFile);
  }

  public boolean isImageFilesEmpty() {
    return this.imageFiles.size() == 0;
  }

  public boolean isTagsEmpty() {
    return this.tags.size() == 0;
  }

}
